#include "GameData.h"
#include "cocos2d.h"
GameData * GameData::me = NULL;
GameData * GameData::getInstance()
{
	if (!me) me = new GameData();
	return me;
}

void GameData::setLevel(int level)
{
	_level = level;
	cocos2d::UserDefault::getInstance()->setIntegerForKey("nowLevel", level);
}
int GameData::getLevel()
{
	if (_level == 0)
	{
		_level = cocos2d::UserDefault::getInstance()->getIntegerForKey("nowLevel");
	}
	return _level;
}